UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dgtosfZRk9ln8dN1wGhf9LlnTJkADQ2qc3FuR1UxqSA='
WHERE
key_id = 'ee96892e596abfe9b82525164968948a6312f8ae232dc91b8379f8ac7928adc7'
AND (
token = 'dgtosfZRk9ln8dN1wGhf9LlnTJkADQ2qc3FuR1UxqSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)