UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nXobRAZiq8NIJKjjyUbZyI4+GiWlcjExdVRXU4m/jKo='
WHERE
key_id = '41d0ab12b01a60337b374dc540bb9593423e2e1a21c9d581a3676c719929ed22'
AND (
token = 'nXobRAZiq8NIJKjjyUbZyI4+GiWlcjExdVRXU4m/jKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)