UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kdCJ24Y5/8pBUq2Q6FV5zY0VwTn9Pn165ibug/G/964='
WHERE
key_id = 'dda61f31bad880778b919d4c0b7a6d6acba86f377104f853879c0ff419853d26'
AND (
token = 'kdCJ24Y5/8pBUq2Q6FV5zY0VwTn9Pn165ibug/G/964='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)