UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PL2cXHUz26vvZiFEBggUtulloW2LUaFvTq2B8KHffyY=' 
WHERE 
  key_id = 'f4f1e5026370594db7ce8a28ad592aeef2aaeddce6d9bdb7122f122c07826754' 
  AND (
    token = 'PL2cXHUz26vvZiFEBggUtulloW2LUaFvTq2B8KHffyY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028