UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JNanBHx9+MFZTuj8eNZveqqwRgq9c+/z6Shi/LJbhhc='
WHERE
key_id = '5e5bbf340d90c096e8487d750b73acb6f4e554f06d94393e7caa4d45ba3c7a4c'
AND (
token = 'JNanBHx9+MFZTuj8eNZveqqwRgq9c+/z6Shi/LJbhhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)