UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mVlrNj7Kgn5Aav8Cym3PFKyoLX2AXZYzG3mEZmDohEc='
WHERE
key_id = '7fe64c6e91e674514c73d2dd7a5d03eb745a54942baf9d3c472d8a5ffe6449c6'
AND (
token = 'mVlrNj7Kgn5Aav8Cym3PFKyoLX2AXZYzG3mEZmDohEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)