UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jfnEmPUBZjF7c72ijoPfgVmps9CFmwS/nq9NAbaxFKc=' 
WHERE 
  key_id = 'a509278c158b006721b7f36a1f4522e0599be263cc5755804a4d113aadb81bc6' 
  AND (
    token = 'jfnEmPUBZjF7c72ijoPfgVmps9CFmwS/nq9NAbaxFKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031