UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LFKmsKPCmEiMhXVQZwZI9iN4ZamEaVVQ380iVIQgj8Q='
WHERE
key_id = 'ce6dcb7a1876fe4e1739a27ac64a0f83850f1350ee665b7d92e4996f89935494'
AND (
token = 'LFKmsKPCmEiMhXVQZwZI9iN4ZamEaVVQ380iVIQgj8Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)