UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zZFbExVqjYrkKKhqqinihPxkaYD3rD/FdePPsmKj0S0='
WHERE
key_id = '901b2bb7c5ac68e861c43675bfc0e48143bd44364eab84f069e9acc1caf1ce6e'
AND (
token = 'zZFbExVqjYrkKKhqqinihPxkaYD3rD/FdePPsmKj0S0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)