UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '10crR03U9d28QZrmSMj2OcsXKf/Le9gbtg/w2aJams0='
WHERE
key_id = '9e29ba773505ad5ec4c73b3cb56c55a855a2d264a1a5d9952ee912dd6b7b89c4'
AND (
token = '10crR03U9d28QZrmSMj2OcsXKf/Le9gbtg/w2aJams0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)