UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BOf8YSSnVIikN/5F3j7X+mt56JTDWDo3kDcIiZpQ9BA='
WHERE
key_id = 'e5dce05cedbbd8f01afca4dee235bdc26ccd3178f1435d16acd93487b77eb626'
AND (
token = 'BOf8YSSnVIikN/5F3j7X+mt56JTDWDo3kDcIiZpQ9BA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)