UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jwxqolksZD3x8gH9rPqKkeMMn4mqrSEjKzBUP4KxdeU='
WHERE
key_id = '31b30a983225b874a72b9df70a6767136f77ff97a5f6e1b2bbeabcee00ac8de5'
AND (
token = 'jwxqolksZD3x8gH9rPqKkeMMn4mqrSEjKzBUP4KxdeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)