UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WBqGvYm8WvKOT1CjQ/Hpgpf1y/MZrXtiZP742713WSA='
WHERE
key_id = '00f49de9c1abdce4db4a27fc680a1d8c667ab405a7330c2bc6c7d014d94b493c'
AND (
token = 'WBqGvYm8WvKOT1CjQ/Hpgpf1y/MZrXtiZP742713WSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)