UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fey3x1ky4buA6UAZO0XU2XHhUeH+4TQRRp/QUClCFPw=' 
WHERE 
  key_id = 'b09a12c897dadd8d6955d89f4038202feec2897997bc73eab79ead6c2a34672f' 
  AND (
    token = 'fey3x1ky4buA6UAZO0XU2XHhUeH+4TQRRp/QUClCFPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029