UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wxlsmRmtpEfIm6j7vtv1BlY67aQNlYbeKkk85pN33IA=' 
WHERE 
  key_id = '779d2c7b509bc9397ce56203c2d1de0af6b049eae26ecc5b9bb0c0ba791dfebd' 
  AND (
    token = 'wxlsmRmtpEfIm6j7vtv1BlY67aQNlYbeKkk85pN33IA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066