UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm1AIfSl7xFuz/5DbMt1isVZRhP+sbJNPErAQRdTrHzY=' 
WHERE 
  key_id = '802f9e1a784e47f085f6a989987e46955a7ec3ba94c2f2182df999fa51f5d302' 
  AND (
    token = 'm1AIfSl7xFuz/5DbMt1isVZRhP+sbJNPErAQRdTrHzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055