UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AiMpqHhSYvOUjsetsdWhAG3t3ZMft/kaqdAnBFFAtqY='
WHERE
key_id = 'e0675e7c855829fc4d1c0ba101b44fd551f6e5e53c61d0e386622586e0f92dce'
AND (
token = 'AiMpqHhSYvOUjsetsdWhAG3t3ZMft/kaqdAnBFFAtqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)