UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nxxzoYVOSA4QrLQa/ZNwuVxIvSFtdJwNGJR8WqUkJCs='
WHERE
key_id = 'fae53e8149a2bd04f7040c478d24e498cba14b322c4c088613bced1f09771857'
AND (
token = 'nxxzoYVOSA4QrLQa/ZNwuVxIvSFtdJwNGJR8WqUkJCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)