UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DmdSC/Y1B32xqqrlUOroxIcf9I6j5TpftAdpvjNTfzA='
WHERE
key_id = '3eda1535ba64802277f5700455473d96fd1faf439ade8e395e765db75e2a2ed5'
AND (
token = 'DmdSC/Y1B32xqqrlUOroxIcf9I6j5TpftAdpvjNTfzA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)