UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R/Kd8fjAy1Vyij6t/ZK51jCtjvDrNGEJ6sEi8dS4fQY=' 
WHERE 
  key_id = '1354cb89b4da41839307b10920c8addeebe8e4e3caa4d3b9ad9eb1e2da5edd7e' 
  AND (
    token = 'R/Kd8fjAy1Vyij6t/ZK51jCtjvDrNGEJ6sEi8dS4fQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050