UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wiGrYgj5k5psk77bMGy9Xs0OAVnOF4Rra9hjtqjwkuY='
WHERE
key_id = '2d55938beefbdd00bc84c61723ff6f27b14065f7cf5b03f95c9a8f5a4fc40a8b'
AND (
token = 'wiGrYgj5k5psk77bMGy9Xs0OAVnOF4Rra9hjtqjwkuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)