UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OxpuS+rURXyYbw0ElrEGAS9m6aQ9ncdixmruOcAN6w8='
WHERE
key_id = 'f6ec550cb1f1c6dd3c0ee45649c4f95b9c9086423de5224cd18972d953cecee8'
AND (
token = 'OxpuS+rURXyYbw0ElrEGAS9m6aQ9ncdixmruOcAN6w8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)