UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sFFF/VPdtCWL794pnB1xg3Q5uHAI0dC07oJgda6fRjY='
WHERE
key_id = 'bb4c91fd8b669661f7ab3cadd0c5396e653a29d9317489c0e0cf6c4736400e9c'
AND (
token = 'sFFF/VPdtCWL794pnB1xg3Q5uHAI0dC07oJgda6fRjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)