UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qwcYuJVo01bG+H2/oQ6IQxR13gP0FidXk0bXwAL8oAY='
WHERE
key_id = '00bbd1bc594071d0ecef617c250329a6be83bdb18ca8f5a4771d2c9369b284aa'
AND (
token = 'qwcYuJVo01bG+H2/oQ6IQxR13gP0FidXk0bXwAL8oAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)