UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qGkOGDgltDGe6iGaJ7Sz340QjBryq5DSZRlytFtYczI='
WHERE
key_id = '0f11e47355150ecf372958841ddf9a37d3587fbd0ab11712803d892a1168ba77'
AND (
token = 'qGkOGDgltDGe6iGaJ7Sz340QjBryq5DSZRlytFtYczI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)