UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'URFdzQR56ce6QUQ9PvlnVrU5y1q6KNdD027wlxUZD+I=' 
WHERE 
  key_id = '64cc69a841593d26f63a68a35159f7191d434f30dd8d272153da9ab636577d76' 
  AND (
    token = 'URFdzQR56ce6QUQ9PvlnVrU5y1q6KNdD027wlxUZD+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039