UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EYqpisV3+6mbWKSwnNTCvj1G45GKpY81Ax7yq7bZlUA=' 
WHERE 
  key_id = 'e97fe4013e3bee9894126dfd71550343c4e271c07bf508c4923da20ce7ec60e7' 
  AND (
    token = 'EYqpisV3+6mbWKSwnNTCvj1G45GKpY81Ax7yq7bZlUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030