UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uYW8XouAzFR3yxfB7b4QAv8DHnDeelXUCejQNy47LYA='
WHERE
key_id = '81e665d5235c2650bc49d4a930edecd3c6e16e2c2af74ddf3dae4dcdc83dc05c'
AND (
token = 'uYW8XouAzFR3yxfB7b4QAv8DHnDeelXUCejQNy47LYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)