UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LPWmZ40GPL5QoX8R+i7K+b3Q9+4isBAbcyMNSp5xdpI='
WHERE
key_id = 'a3c2e867e0b3ea689abe7d890724f186f8e4b41b04adc9460a50eb326d659d4c'
AND (
token = 'LPWmZ40GPL5QoX8R+i7K+b3Q9+4isBAbcyMNSp5xdpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)