UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tiA/VQrsYaWLfO0ucqu1A5GmpOu4MfCHUREgZCEqLBE='
WHERE
key_id = 'f8ba29be0021b38376c8664db56ad4d503c1605cc72b5ebaa3edb74951d1b095'
AND (
token = 'tiA/VQrsYaWLfO0ucqu1A5GmpOu4MfCHUREgZCEqLBE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)